<template>
	<view class="flex-col page">
		<view>
			<view :style="{height:statusBarHeight+'px'}"></view>
			<u-navbar title="物流信息" bgColor="#F5F5F5" @leftClick="$nav(2)">	
			</u-navbar>
		</view>
		
		
		<my-logistics :info="logInfo" :logisticsTraceDetailList="logisticsTraceDetailList"></my-logistics>
		
		
	</view>
</template>

<script>
	import myLogistics from '@/components/logistics.vue';
	export default {
		components: {
			myLogistics
		},
		data() {
			return {
				orderInfo:{},
				logInfo:{},
				logisticsTraceDetailList:[]
			};
		},
		onLoad(op) {
			this.orderInfo = JSON.parse(decodeURIComponent(op.order));	
			this.getOrderLog();
		},
		computed:{
			statusBarHeight(){
				return this.$store.state.statusBarHeight + 44
			}
		},
		methods:{
			getOrderLog(){
				this.$request({
					url:'?c=Order&a=expressInfo',
					type:'post',
					data:{
						order_id:this.orderInfo.order_id,
					}
				}).then(res =>{
					// console.log(res)
					this.logInfo = res.data;
					if(res.data.logisticsTraceDetailList){
						this.logisticsTraceDetailList = res.data.logisticsTraceDetailList
						this.logisticsTraceDetailList.reverse()
					}
				})
			}
		}
	}
</script>

<style lang="scss">
.page{
	width: 100%;
	overflow-y: auto;
	overflow-x: hidden;
	height: 100%;
}
.body-bg{
	background-color: #fff;
	padding: 20rpx;
	border-radius: 10rpx;
	margin: 20rpx;
}
</style>
